import React from 'react';
import { Breadcrumb } from 'antd';
import { Link } from 'react-router';

class BreadcrumbCustom extends React.Component {
    state = {
        switcherOn: false,
        theme: null,
        themes: JSON.parse(localStorage.getItem('themes')) || [
            {type: 'info', checked: false},
            {type: 'grey', checked: false},
            {type: 'danger', checked: false},
            {type: 'warn', checked: false},
            {type: 'white', checked: false},
        ],
    };
    componentDidMount() {
    }
    render() {
        const breadList = this.props.breadList;
        return (
            <span>
                {breadList && breadList.length>0?
                    <Breadcrumb style={{ margin: '12px 0' }}>
                    {
                        breadList.map(function(item,index){
                        return(
                            <Breadcrumb.Item key={index}>
                                {item.link && item.link.length>0?
                                    <Link to={item.link}>{item.name}</Link>
                                    :<Link>{item.name}</Link>
                                }
                            </Breadcrumb.Item>
                        )
                        })
                    }
                    </Breadcrumb>
                    :""
                }
            </span>
        )
    }
}

export default BreadcrumbCustom;
